home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / src / wmesadef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-24  |  2.5 KB  |  101 lines

  1. /*    File name    :    wmesadef.h
  2.  *  Version        :    2.0
  3.  *
  4.  *  Header file for display driver for Mesa 2.0  under 
  5.  *    Windows95, WindowsNT and Win32
  6.  *
  7.  *    Copyright (C) 1996-  Li Wei
  8.  *  Address        :        Institute of Artificial Intelligence
  9.  *                :            & Robotics
  10.  *                :        Xi'an Jiaotong University
  11.  *  Email        :        liwei@aiar.xjtu.edu.cn
  12.  *  Web page    :        http://sun.aiar.xjtu.edu.cn
  13.  *
  14.  *  This file and its associations are partially based on the 
  15.  *  Windows NT driver for Mesa, written by Mark Leaming
  16.  *  (mark@rsinc.com).
  17.  */
  18.  
  19. /*
  20.  * $Log: wmesadef.h,v $
  21.  * Revision 2.0  1996/11/15 10:54:00  CST by Li Wei(liwei@aiar.xjtu.edu.cn)
  22.  * Initial revision
  23.  */
  24.  
  25.  
  26.  
  27. #ifndef WMESADEF_H
  28. #define WMESADEF_H
  29.  
  30. #include <GL\gl.h>
  31. #include <context.h>
  32. //#include "profile.h"
  33.  
  34. #define REDBITS        0x03
  35. #define REDSHIFT    0x00
  36. #define GREENBITS    0x03
  37. #define GREENSHIFT    0x03
  38. #define BLUEBITS    0x02
  39. #define BLUESHIFT    0x06
  40.  
  41.  
  42. typedef struct _dibSection{
  43.     HDC        hDC;
  44.     HANDLE    hFileMap;
  45.     BOOL    fFlushed;
  46.     LPVOID    base;
  47. }WMDIBSECTION, *PWMDIBSECTION;
  48.  
  49.  
  50. typedef struct wmesa_context{
  51.     GLcontext *gl_ctx;        /* The core GL/Mesa context */
  52.     GLvisual *gl_visual;        /* Describes the buffers */
  53.     GLframebuffer *gl_buffer;    /* Depth, stencil, accum, etc buffers */
  54.  
  55.  
  56.     HWND                Window;
  57.     HDC                 hDC;
  58.     HPALETTE            hPalette;
  59.     HPALETTE            hOldPalette;
  60.     HPEN                hPen;
  61.     HPEN                hOldPen;
  62.     HCURSOR             hOldCursor;
  63.     COLORREF            crColor;
  64.     // 3D projection stuff 
  65.     RECT                drawRect;
  66.     UINT                uiDIBoffset;
  67.     // OpenGL stuff 
  68.     HPALETTE            hGLPalette;
  69.     GLuint                width;
  70.     GLuint                height;
  71.     GLuint                ScanWidth;
  72.     GLboolean            db_flag;    //* double buffered? 
  73.     GLboolean            rgb_flag;    //* RGB mode? 
  74.     GLuint                depth;        //* bits per pixel (1, 8, 24, etc) 
  75.     ULONG                pixel;    // current color index or RGBA pixel value 
  76.     ULONG                clearpixel; //* pixel for clearing the color buffers 
  77.     PSTR                ScreenMem; // WinG memory
  78.     BITMAPINFO            *IndexFormat;
  79.     HPALETTE            hPal; // Current Palette
  80.  
  81.     BITMAPINFO          bmi;
  82.     HBITMAP             hbmDIB;
  83.     HBITMAP             hOldBitmap;
  84.     HBITMAP                Old_Compat_BM;
  85.     HBITMAP                Compat_BM;            // Bitmap for double buffering 
  86.     PBYTE               pbPixels;
  87.     int                 nColors;
  88.     BYTE                cColorBits;
  89.     WMDIBSECTION        dib;
  90. //#ifdef PROFILE
  91. //    MESAPROF    profile;
  92. //#endif
  93. }  *PWMC;
  94.  
  95.  
  96. #define PAGE_FILE        0xffffffff
  97.  
  98.  
  99. #include "colors.h"
  100.  
  101. #endif